import React, { Suspense } from 'react';
import { useRoutes } from 'react-router-dom'
import { useSelector, useDispatch } from 'react-redux';
import { getRoutes } from './utils/getRoute';
import '@/App.css';
import routes from './router/routeConfig'

function App() {
  var checkedKeys = localStorage.getItem('checkedKeys') ? localStorage.getItem('checkedKeys') : []
  // console.log(checkedKeys);

  var res = getRoutes(routes, checkedKeys)
  // console.log(res);

  return (
    <div className="App">
      {/* 渲染路由规则 */}
      <Suspense>
        {useRoutes(res)}
      </Suspense>
    </div>
  );
}

export default App;
